﻿Ext.override(Ext.form.action.Submit, {
    onSuccess: function (response) {
        var form = this.form, success = true, result = this.processResponse(response);
        if (Ext.isDefined(result)) {
            if (!result.success) {
                form.markInvalid(!result.success);
                this.failureType = Ext.form.action.Action.SERVER_INVALID;
                success = false;
            }
            form.afterAction(this, success);
        } else
            form.afterAction(this, false);
    }
});